<?php

class Form_ClientLogin extends App_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);

        // change the class on the outer <dl> tag
        $this->getDecorator('HtmlTag')->setOption('class', 'form');

        $this->setName('login');
        
        
        $model_service = new Model_Service();
    	$all_services = $model_service->getAllService();
                
        $departments=array();
        $departments[ '0' ] = "YesUp account";
        //$departments[ '1' ] = "Google account";
/*        
        foreach($all_services as $key =>$item){
        	$departments[ $item['dpt_id'] ] = $item['dpt_name'];
        }
*/        		
		$dpt = $this->selectElement('dpt_id', '', $departments);
        
        $username = $this->textElement('username', 'Account Email:');

        $password = $this->password('password','Password');
       
        $redirect = $this->hiddenElement('_redirect_url');

        $submit = $this->submit('submit', 'Login');
        
        $this->addElements(array($dpt, $username, $password, $redirect, $submit));
    }

    public function setRedirectUrl($url){
		$this->getElement('_redirect_url')->setValue($url);
	}

	public function getRedirectUrl(){
		return $this->getElement('_redirect_url')->getValue();
	}

}
